<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>
<ul>
    <li>
        <img src="images/f01.jpg" id="first">
        <p><input type="button" value="删除我吧" onclick="del()"></p>
    </li>
    <li>
        <img src="images/f02.jpg" id="second">
        <p><input type="button" value="换换我吧" onclick="rep()"></p>
    </li>
</ul>
<script>
    function del() {
        var delNode=document.getElementById("first");
        delNode.parentNode.removeChild(delNode);
    }
    function rep() {
        var oldNode=document.getElementById("second");
        var newNode=document.createElement("img");
        newNode.setAttribute("src","images/f03.jpg");
        oldNode.parentNode.removeChild(newNode,oldNode);
    }
</script>
</body>
</html>